package cn.cloud.all.security.web.util.matcher;

import java.beans.PropertyEditorSupport;

/**
 * PropertyEditor which creates ELRequestMatcher instances from Strings
 * <p>
 * This allows to use a String in a BeanDefinition instead of an (inner) bean if a
 * RequestMatcher is required, e.g. in {@link DelegatingAuthenticationEntryPoint}
 */
public class RequestMatcherEditor extends PropertyEditorSupport {

    @Override
    public void setAsText(String text) throws IllegalArgumentException {
        setValue(new ELRequestMatcher(text));
    }
}
